package main

import (
	"context"
	"fmt"
	"github.com/go-redis/redis/v8"
	"time"
)

func main() {
	rdb := redis.NewClient(&redis.Options{
		Addr:     "192.168.16.110:6379",
		Password: "", // no password set
		DB:       0,  // use default DB
	})
	rdb.Set(context.Background(), "121233", "123456", 60*5*time.Second)
	value, err := rdb.Get(context.Background(), "121233").Result()
	if err == redis.Nil {
		fmt.Println("key 不存在")
	}
	fmt.Println(value)
}
